package com.lemon.smartsafetynew.util.incident;

import com.lemon.smartsafety.R;
import com.lemon.smartsafetynew.entity.incident.IncidentBo;

/**
 * Created by Andrew on 2017/9/11.
 */

public class IncidentUtil {

    public static int getIncidentBackground(String status) {

        int res;

        if (IncidentBo.Status.to_do.getValue().equals(status)) {
            res = R.drawable.bg_incident_processing;
        } else {
            res = R.drawable.bg_incident_processed;
        }

        return res;
    }

    public static boolean isDone(String status) {

         boolean result;

        if (IncidentBo.Status.to_do.getValue().equals(status)) {
            result = false;
        } else {
            result = true;
        }

        return result;
    }

    public static int getIncidentSourceImage(String source_type) {

        int res;

        if (IncidentBo.SourceType.patrol_task.getValue().equals(source_type)) {
            res = R.mipmap.menu_icon_company_info;
        } else {
            res = R.mipmap.menu_icon_company_info;
        }

        return res;
    }

    public static int getIncidentSourceStrRes(String source_type) {

        int res;

        if (IncidentBo.SourceType.patrol_task.getValue().equals(source_type)) {
            res = R.string.work_options_main_1;
        } else {
            res = R.string.work_options_main_1;
        }

        return res;
    }

    public static boolean isClose(String result) {

        boolean ret;

        if (IncidentBo.Result.close.getValue().equals(result)) {
            ret = true;
        } else {
            ret = false;
        }

        return ret;
    }

}
